home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / HATSHAPE.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-28  |  3.6 KB  |  135 lines

  1. 10  'HATSHAPE - Capacity Hat Geometric Shapes - 19 DEC 95 rev.07 DEC 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  COMMON EX$
  4. 40  CLS:KEY OFF
  5. 50  COLOR 7,0,1
  6. 60  UL$=STRING$(80,205)
  7. 70  U$="#####.#"
  8. 80  '
  9. 90  '.....start
  10. 100  CLS:C=0:CD=0:CS=0:CC=0:D=0:DD=0:DS=0:DC=0
  11. 110  COLOR 15,2
  12. 120  PRINT " CAPACITY HAT GEOMETRIC SHAPES";TAB(57);"by George Murphy VE3ERP ";
  13. 130  COLOR 1,0:PRINT STRING$(80,223);
  14. 140  COLOR 7,0
  15. 150  GOSUB 920    'preface
  16. 160  PRINT UL$;
  17. 170  PRINT " Press number in < > to:"
  18. 180  PRINT UL$;
  19. 190  PRINT "   < 1 >  Find CAPACITANCE of Shapes of Known DIAMETER"
  20. 200  PRINT "   < 2 >  Find DIAMETER of Shapes of Known CAPACITANCE"
  21. 210  PRINT "   < 3 >  Run the W4RNL Capacitive Hat Calculator program"
  22. 220  PRINT UL$;
  23. 230  PRINT "   < 0 >  EXIT"
  24. 240  Z$=INKEY$:IF Z$=""THEN 240
  25. 250  IF Z$="0"THEN CLS:RUN EX$
  26. 260  IF Z$="1"THEN 430
  27. 270  IF Z$="2"THEN 470
  28. 280  IF Z$="3"THEN CLS:CHAIN "capyhat"
  29. 290  GOTO 240
  30. 300  '
  31. 310  '.....unit of measure
  32. 320  LOCATE CSRLIN-1:PRINT STRING$(80,32);:LOCATE CSRLIN-1
  33. 330  COLOR 0,7
  34. 340  PRINT " Do you want Diameter in (c)entimetres or (i)nches?  (c/i)"
  35. 350  COLOR 7,0
  36. 360  Z$=INKEY$:IF Z$=""THEN 360
  37. 370  IF Z$="i"THEN M=1:M$="in.":GOTO 400
  38. 380  IF Z$="c"THEN M=1/2.54:M$="cm.":GOTO 400
  39. 390  GOTO 360
  40. 400  LOCATE CSRLIN-1:PRINT STRING$(80,32);:LOCATE CSRLIN-1
  41. 410  RETURN
  42. 420  '
  43. 430  '.....input diameter
  44. 440  GOSUB 310
  45. 450  PRINT " ENTER: Diameter of shape (";M$;")......";:INPUT D:D=D*M:GOTO 510
  46. 460  '
  47. 470  '.....input capacitance
  48. 480  GOSUB 310
  49. 490  INPUT " ENTER: Capacitance of shape (pF)......";C:GOTO 510
  50. 500  '
  51. 510  '.....calculate
  52. 520  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  53. 530  IF C=0 THEN CD=D*0.89:CS=D*1.4:CC=D*2.04:GOTO 560
  54. 540  IF D=0 THEN DD=C/0.89:DS=C/1.4:DC=C/2.04:GOTO 560
  55. 550  '
  56. 560  '.....screen print
  57. 570  GOSUB 920
  58. 580  PRINT UL$;
  59. 590  D$=STRING$(24,".")
  60. 600  IF C<>0 THEN 720
  61. 610  IF D<>0 THEN 630
  62. 620  '
  63. 630  PRINT USING U$;D/M;:PRINT " ";M$;" dia. DISC.....";D$;
  64. 640  LOCATE CSRLIN,45:PRINT USING U$;CD;:PRINT " pF"
  65. 650  PRINT USING U$;D/M;:PRINT " ";M$;" dia. SPHERE...";D$;
  66. 660  LOCATE CSRLIN,45:PRINT USING U$;CS;:PRINT " pF"
  67. 670  PRINT USING U$;D/M;:PRINT " ";M$;" dia. CYLINDER,";D$;
  68. 680  LOCATE CSRLIN,27:PRINT USING U$;D/M;:PRINT " ";M$;" long";
  69. 690  LOCATE CSRLIN,45:PRINT USING U$;CC;:PRINT " pF"
  70. 700  GOTO 800
  71. 710  '
  72. 720  PRINT USING U$;C;:PRINT " pF DISC.....";D$;
  73. 730  LOCATE CSRLIN,40:PRINT USING U$;DD/M;:PRINT " ";M$;" dia."
  74. 740  PRINT USING U$;C;:PRINT " pF SPHERE...";D$;
  75. 750  LOCATE CSRLIN,40:PRINT USING U$;DS/M;:PRINT " ";M$;" dia."
  76. 760  PRINT USING U$;C;:PRINT " pF CYLINDER,";D$;
  77. 770  LOCATE CSRLIN,40:PRINT USING U$;DC/M;:PRINT " ";M$;" dia.,";
  78. 780  PRINT USING U$;DC/M;:PRINT " ";M$;" long"
  79. 790  '
  80. 800  PRINT UL$;
  81. 810  PRINT TAB(T);
  82. 820  PRINT "Values shown are sufficiently accurate for many amateur radio"
  83. 830  PRINT TAB(T);
  84. 840  PRINT "applications. Actual values may differ slightly due to site"
  85. 850  PRINT TAB(T);
  86. 860  PRINT "conditions and antenna construction."
  87. 870  PRINT UL$;
  88. 880  PRINT TAB(T);
  89. 890  PRINT "Reference: The ARRL ANTENNA BOOK, 17th Edition, page 2-39";
  90. 900  GOTO 1170
  91. 910  '
  92. 920  '.....preface
  93. 930  T=8
  94. 940  PRINT TAB(T);
  95. 950  PRINT "Physically shortened vertical antennas can be top-loaded with a"
  96. 960  PRINT TAB(T);
  97. 970  PRINT "flat-top 'Capacity Hat' to compensate for the missing height."
  98. 980  PRINT TAB(T);
  99. 990  PRINT "Practically any sufficiently large metallic structure can be used"
  100. 1000  PRINT TAB(T);
  101. 1010  PRINT "for the purpose, but simple geometric forms such as the sphere,"
  102. 1020  PRINT TAB(T);
  103. 1030  PRINT "cylinder and disc are preferred because of the relative ease with"
  104. 1040  PRINT TAB(T);
  105. 1050  PRINT "which their capacitance can be calculated."
  106. 1060  PRINT
  107. 1070  PRINT TAB(T);
  108. 1080  PRINT "These shapes can be constructed of sheet metal if such construction"
  109. 1090  PRINT TAB(T);
  110. 1100  PRINT "is feasible, but the capacitance will be practically the same in"
  111. 1110  PRINT TAB(T);
  112. 1120  PRINT "each case if a 'skeleton' construction with screening or networks"
  113. 1130  PRINT TAB(T);
  114. 1140  PRINT "of wire or aluminum tubing is used."
  115. 1150  RETURN
  116. 1160  '
  117. 1170  '.....end
  118. 1180  GOSUB 1220
  119. 1190  GOTO 90   'start
  120. 1200  END
  121. 1210  '
  122. 1220  'HARDCOPY
  123. 1230  GOSUB 1340:LOCATE 25,2:COLOR 14,6
  124. 1240  PRINT " Press 1 to print screen, 2 to print screen & ";
  125. 1250  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  126. 1260  Z$=INKEY$:IF Z$="3"THEN GOSUB 1340:RETURN
  127. 1270  IF Z$="1"OR Z$="2"THEN GOSUB 1340:GOTO 1290
  128. 1280  GOTO 1260
  129. 1290  FOR QX=1 TO 24:FOR QY=1 TO 80
  130. 1300  LPRINT CHR$(SCREEN(QX,QY));
  131. 1310  NEXT QY:NEXT QX
  132. 1320  IF Z$="2"THEN LPRINT CHR$(12)
  133. 1330  GOTO 1230
  134. 1340  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  135.